FIG. 1 shows an example of a scanned document image 102. As illustrated, scanned document image 102 may contain large areas of black color 105 around the perimeters of the document 101. Black border 105 typically appears where the scanning sensor was not completely covered by the document 101. It is desirable to adjust the size of the scanned image to correspond to the size of the original document 101 to eliminate or substantially reduce the black border 105 that is scanned. This adjustment is called cropping.
Cropping images of documents scanned using a contact image sensor (CIS) is particularly challenging because these types of sensors sometimes produce scanning defects such as speckles 106a-106e, edge defects 107, and/or white stripes 108 running perpendicular to the direction of the scanning. CIS defects can also take the form of a white area on the top and possibly the bottom of the document. They can also appear as white stripes (i.e., stripes the same color as the background of the scanned document image) running parallel to the direction of the scanning of the document.
As illustrated in FIG. 1, cropping is further complicated by areas of black color 103 (i.e., areas opposite in color to the background of the scanned document) within the document 101. Ordinary cropping methods have problems distinguishing between the black area 111 (which may have white text 109) of the document 101 from the black area 105 that surrounds the document 101. A method and apparatus are desired that allow for accurate cropping of images that have areas of black color, particularly when such CIS defects are present.